package com.ruoyi.erp.controller;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.dingtalk.service.DingTalkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 钉钉接口Controller
 *
 * @author sauger
 * @date 2022-04-015
 */
@Controller
@RequestMapping("/dingtalk/callback")
public class DingTalkController {
    @Autowired
    private DingTalkService dingTalkService;

    @PostMapping("")
    @ResponseBody
    public Map<String, String> dingCallback(HttpServletRequest request,@RequestBody JSONObject jsonObject) {
        return dingTalkService.dingCallback(request, jsonObject);
    }

}
